FUNCTION
add_auth_handler
function add_auth_handler(scope: text, flags: list<text>, message: (gtv) -> text?, resolver: (gtv, byte_array, list<byte_array>) -> byte_array??): map<text, _auth_handler>Utility function that allows easily adding an auth handler.
It should be used by dapps, while library developers should generally prefer using
add_overridable_auth_handler instead, allowing dapps to override the default handler.
Throws if scope is not valid
Example:
operation my_op() { ... }
@extend(auth.auth_handler)
function () = auth.add_auth_handler(
rell.meta(my_op).mount_name,
flags,
message_function,
resolver_function
);
Parameters
- scope — The scope of the auth handler - either an operation name or a mount point
- flags — The
flagsparameter of the auth handler - message — The
messageparameter of the auth handler - resolver — The
resolverparameter of the auth handler
See Also
- _auth_handler — for more information on
flags,messageandresolver - get_auth_handler — for a definition of auth handler scope
© 2024 Chromia